package com.chg.mymvc.service;

import com.chg.mymvc.dao.NewsDaoImpl;
import com.chg.mymvc.entity.News;

import java.util.List;

public class NewsServiceImpl implements NewsService{
    private NewsDaoImpl nd= new NewsDaoImpl();
    @Override
    public void delNews(int id) {
        nd.delNews(id);
    }

    @Override
    public void updateNews(News news) {
nd.updateNews(news);
    }

    @Override
    public List<News> queryAll(int page, int pagesize) {
        return nd.queryAll(page,pagesize);
    }

    @Override
    public List<News> queryAllofperm(int page, int pagesize, String pername) {
        return nd.queryAllofperm(page,pagesize,pername);
    }

    @Override
    public News getNewsByName(String name) {
        return nd.getNewsByName(name);
    }

    @Override
    public List<News>  getNewssByName(String name) {
        return nd.getNewssByName(name);
    }

    @Override
    public int addNews(News news) {
        return nd.addNews(news);
    }

    @Override
    public News selecNewstById(int id) {
        return nd.selecNewstById(id);
    }

    @Override
    public int allcount() {
        return nd.allcount();
    }


}
